# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=libcerf
epoch=1
pkgver=1.17
pkgrel=1
pkgdesc='Self-contained numeric library that provides an efficient and accurate implementation of complex error functions'
arch=(x86_64)
url='https://jugit.fz-juelich.de/mlz/libcerf/'
license=(custom)
depends=(glibc)
makedepends=(cmake)
source=(https://jugit.fz-juelich.de/mlz/libcerf/-/archive/v$pkgver/libcerf-v$pkgver.tar.gz)
sha256sums=('b1916b292cb37f2d0d0b699fbcf0fe260cca97ec7266ea20ff0c5cd8ef2eaab4')

build() {
  cmake -B build -S $pkgname-v$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  install -Dm644 $pkgname-v$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
